package crawler.searchFilter;

import java.util.ArrayList;

import crawler.VideoItem;
import data.database.DatabaseConnection;

/**
 * Search Filter
 * @author ladjzero
 *
 */
public abstract class Filter {
	protected ArrayList<VideoItem> videoList;
	protected String keywords;
	
	public Filter(String keywords){
		this.keywords = keywords;
		videoList = getVideoList();
	}
	
	protected abstract ArrayList<VideoItem> getVideoList();
	
	public void submitToDatabase(String tableName){
		DatabaseConnection dc = new DatabaseConnection("121.49.110.106:3306/videose", "root", "ladjzero");
		dc.batchInsert(videoList, tableName);
	}
}
